package logic

import (
	"context"
	"zk1/common/proto/user"
	"zk1/rpc/server"
)

type UserRegister struct {
	user.UnimplementedUserServer
}

func (u UserRegister) SendSms(ctx context.Context, in *user.SendSmsRequest) (*user.SendSmsResponse, error) {
	sms, err := server.SendSms(in)
	if err != nil {
		return nil, err
	}
	return sms, nil
}

func (u UserRegister) RegisterLogin(ctx context.Context, in *user.RegisterLoginRequest) (*user.RegisterLoginResponse, error) {
	login, err := server.RegisterLogin(in)
	if err != nil {
		return nil, err
	}
	return login, nil
}

func (u UserRegister) HomePage(ctx context.Context, in *user.HomePageRequest) (*user.HomePageResponse, error) {
	page, err := server.HomePage(in)
	if err != nil {
		return nil, err
	}
	return page, nil
}
